package com.six.controller;

import com.six.api.CommonResult;
import com.six.dto.HomeDisplayDto;
import com.six.service.HomeDisplayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lx
 * @date 2022/12/10
 */
@RestController
@RequestMapping("/homeDisplay")
public class HomeDisplayController {
    @Autowired
    private HomeDisplayService homeDisplayService;

    @RequestMapping("findAll")
    public CommonResult findAll(){

        List<HomeDisplayDto> homeDisplayDtoList = homeDisplayService.findAll();

        CommonResult commonResult = CommonResult.success(homeDisplayDtoList);
        commonResult.setData(homeDisplayDtoList);

        System.out.println(homeDisplayDtoList);
        return commonResult;
    }
}
